//
//  ServiceMercFuncVM.swift
//  kxf
//
//  Created by Mac on 2024/3/10.
//

import Foundation
import UIKit

class ServiceMercFuncVM: UIView {
    
    let selfHeight = MineFuncItemVM().selfHeight*5

    override init(frame:CGRect){
        super.init(frame: CGRect.init(x: kFitWidth(16), y: frame.origin.y, width: SCREEN_WIDHT-kFitWidth(32), height: selfHeight))
        self.backgroundColor = .white
        self.isUserInteractionEnabled = true
        self.layer.cornerRadius = kFitWidth(14)
        self.clipsToBounds = true
        
        initUI()
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    lazy var authenVM : MineFuncItemVM = {
        let vm = MineFuncItemVM.init(frame: CGRect.init(x: 0, y: 0, width: 0, height: 0))
        vm.titleLabel.text = "实名认证"
        vm.rightLabel.text = "已实名"
        return vm
    }()
    lazy var inviteCodeVm : MineFuncItemVM = {
        let vm = MineFuncItemVM.init(frame: CGRect.init(x: 0, y: self.authenVM.frame.maxY, width: 0, height: 0))
        vm.titleLabel.text = "邀请码"
        vm.arrowImgView.isHidden = true
        return vm
    }()
    lazy var bankCardVm : MineFuncItemVM = {
        let vm = MineFuncItemVM.init(frame: CGRect.init(x: 0, y: self.inviteCodeVm.frame.maxY, width: 0, height: 0))
        vm.titleLabel.text = "银行卡"
        return vm
    }()
    lazy var rebateVm : MineFuncItemVM = {
        let vm = MineFuncItemVM.init(frame: CGRect.init(x: 0, y: self.bankCardVm.frame.maxY, width: 0, height: 0))
        vm.titleLabel.text = "收益明细"
        return vm
    }()
    lazy var serviceMercFeeVm : MineFuncItemVM = {
        let vm = MineFuncItemVM.init(frame: CGRect.init(x: 0, y: self.bankCardVm.frame.maxY, width: 0, height: 0))
        vm.titleLabel.text = "服务商费率"
        return vm
    }()
    lazy var settingVm : MineFuncItemVM = {
        let vm = MineFuncItemVM.init(frame: CGRect.init(x: 0, y: self.serviceMercFeeVm.frame.maxY, width: 0, height: 0))
        vm.titleLabel.text = "设置"
        return vm
    }()
//    lazy var updatePswVm : MineFuncItemVM = {
//        let vm = MineFuncItemVM.init(frame: CGRect.init(x: 0, y: self.serviceMercFeeVm.frame.maxY, width: 0, height: 0))
//        vm.titleLabel.text = "修改登录密码"
//        return vm
//    }()
    lazy var logoutVm : MineFuncItemVM = {
        let vm = MineFuncItemVM.init(frame: CGRect.init(x: 0, y: self.serviceMercFeeVm.frame.maxY, width: 0, height: 0))
        vm.titleLabel.text = "退出"
        return vm
    }()
}

extension ServiceMercFuncVM{
    func initUI(){
        addSubview(authenVM)
        addSubview(inviteCodeVm)
        addSubview(bankCardVm)
//        addSubview(rebateVm)
        addSubview(settingVm)
        addSubview(serviceMercFeeVm)
//        addSubview(updatePswVm)
//        addSubview(logoutVm)
    }
}
